var oBtn = document.querySelector("button");
var tar = document.querySelector("p");
var timer = null;
var width = 1;

function setStatue() {
  if (width >= 100) {
    clearInterval(timer);
    width = 1;
  } else {
    width++;
    tar.style.width = width + '%';
  }
}

oBtn.onclick = function () {
  timer = setInterval(setStatue, 20);
}